home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 6865 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.5 KB  |  65 lines

  1. Path: news.join.ad.jp!wnoc-tyo-news!spinnews!spinchb!okigw!okigw2!aoi!aoi!sai
  2. From: sai@okilab.oki.co.jp (Cui Jin)
  3. Newsgroups: comp.lang.c++
  4. Subject: calling a function in library compiled with C
  5. Date: 20 Feb 96 15:47:09
  6. Organization: Oki Electric Industry Co.,Ltd., Minato-ku, Tokyo, Japan.
  7. Distribution: comp
  8. Message-ID: <SAI.96Feb20154709@jasmine.okilab.oki.co.jp>
  9. Reply-To: sai@okilab.oki.co.jp
  10. NNTP-Posting-Host: jasmine.okilab.oki.co.jp
  11.  
  12.  
  13. My program:
  14. -----------
  15. .......
  16.  
  17. 16    class dict {
  18. 17      char* fileName;
  19. 18      int fpd;
  20. 19    public:
  21. 20      int open(char*, int);
  22. 21      void close(int);
  23. 22    };
  24. 23
  25. 24  int
  26. 25  dict::open(char* fileName, int fpd)
  27. 26  {
  28. 27    cout << "fileName = " << fileName << "\n";
  29. 28    if((fpd = cbopen(fileName)) == NULL)
  30. 29      {       ^^^^^^^^^^^^^^^^
  31. .......           THIS IS A FUNCTION COMPILED WITH C.
  32.  
  33.  
  34. The function cbopen in library compiled with C:
  35. -----------------------------------------------
  36.  
  37. int cbopen(CBname)
  38.   char *CBname;
  39. {
  40. .......
  41.  
  42.  
  43.  
  44. Comply result:
  45. --------------
  46. % make
  47. c++ -I./inc -I./../CBMS/lib/inc -g -c ./main.cc -o ./obj/main.o
  48. ./main.cc: In method `int dict::open(char *, int)':
  49. ./main.cc:28: warning: implicit declaration of function `int cbopen(...)'
  50.  
  51.  
  52. !!! The compiled program can work normally !!!
  53. ----------------------------------------------
  54.  
  55. HELP! HELP! HELP! HELP! HELP! HELP! HELP! HELP! HELP! HELP!
  56.  
  57. Could anyone teach me the meaning of the warning message, and
  58. point me a way to modify my C++ program and make compile can be
  59. completed without _warning message_.
  60.  
  61. Thanks in advance.
  62.  
  63. --
  64. Jin Cui
  65.